package pers.cj.pdos.service;

import org.apache.ibatis.annotations.Param;
import pers.cj.pdos.entity.Packet;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.entity.PacketGoods;
import pers.cj.pdos.vo.PacketSaleVo;
import pers.cj.pdos.vo.PacketVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface IPacketService extends IService<Packet> {

    List<PacketSaleVo> listSaleByPacketId(Integer page,
                                          Integer limit,
                                          Boolean close,
                                          String search,
                                          String packetId,
                                          String storeId,
                                          String userId,
                                          Date date1,
                                          Date date2);
    Long countSaleByPacketId(Boolean close,
               String search,
               String packetId,
               String storeId,
               String userId,
               Date date1,
               Date date2);

    boolean checkName(String name, String companyId);

    boolean checkNo(String no, String companyId);

    void insert(Packet packet, List<PacketGoods> packetGoodsList);
    void update(Packet packet, List<PacketGoods> packetGoodsList);

    /**
     * 获取带库存的列表，库存在PacketGoodsVo中
     * @param companyId
     * @param page
     * @param limit
     * @param status
     * @param content
     * @param houseId
     * @return
     */
    List<PacketVo> listVoWithStock(String companyId, Integer page, Integer limit, Integer status, String content, String houseId);

    List<PacketVo> listVoPage(String companyId, Integer page, Integer limit, Integer status, String content);

    long count(String companyId, Integer status, String content);

    PacketVo getVoById(String id);

    void delete(Packet packet);

    List<PacketVo> listVoByIds(List<String> ids);

    List<PacketVo> listVoByPacketListWithStock(String houseId, List list);

    boolean check(String id);

}
